package com.dyzx.hbb.modules.fcxs.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dyzx.hbb.common.config.MyLambdaQueryWrapper;
import com.dyzx.hbb.modules.fcxs.entity.FcxsCustomer;
import com.dyzx.hbb.modules.fcxs.service.FcxsCustomerService;
import com.dyzx.hbb.modules.fcxs.mapper.FcxsCustomerMapper;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 客户服务实现类
 * 
 * 功能说明：实现客户表的业务逻辑操作，包括客户信息的查询、添加、修改、删除等功能
 * 主要职责：
 * - 实现客户信息的CRUD操作
 * - 根据ID查询客户详细信息
 * - 构建客户信息查询条件
 * 
 * @author 开发团队
 * @version 1.0.0
 * @since 2025-05-17
 */
@Service
public class FcxsCustomerServiceImpl extends ServiceImpl<FcxsCustomerMapper, FcxsCustomer>
    implements FcxsCustomerService{

    @Override
    public Map<String, Object> findById(Long customerId) {
        return this.getMap(queryInfoWrapper().eq(FcxsCustomer::getId, customerId));
    }


    protected MyLambdaQueryWrapper<FcxsCustomer> queryInfoWrapper() {
        MyLambdaQueryWrapper<FcxsCustomer> queryWrapper = new MyLambdaQueryWrapper<>();
        queryWrapper.select(FcxsCustomer::getId)
                .select(FcxsCustomer::getName)
                .select(FcxsCustomer::getPhone)
                .select(FcxsCustomer::getCardNum)
                .select(FcxsCustomer::getCreateDate);
        return queryWrapper;
    }
}




